package zy.zy9;

import java.io.*;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        BufferedReader bufferedReader=null;
        BufferedWriter bufferedWriter=null;
        try {
            bufferedReader=new BufferedReader(new FileReader("E:\\模板.txt"));
            bufferedWriter=new BufferedWriter(new FileWriter("E:\\物流.txt",true));

            System.out.println("请输入快递号、地址及取件码：");
            String s1=sc.next();
            String s2=sc.next();
            String s3=sc.next();

            String str=bufferedReader.readLine();
            String str1=str.replace("{danhao}",s1);
            String str2=str1.replace("{weizhi}",s2);
            String str3=str2.replace("{tiquma}",s3);
            bufferedWriter.write(str3);

        } catch (Exception e) {
            e.printStackTrace();
        }finally {
            try {
                bufferedReader.close();
                bufferedWriter.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
